<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="../static/css/toastr.min.css">
    <script src="../static/js/jquery.min.js"></script>
    <script src="../static/js/toastr.min.js"></script>
    <title>Document</title>
</head>
<body style="text-align:center;" background="timg.jpg">
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
    <form method="POST" action="/upload" enctype="multipart/form-data">
        <input type="file" name="file" id="file">
        <input type="submit" style="width:90px;height:30px;" value="upload">
        <a href=""></a>
    </form><hr>
    <ol id="filelist">
    </ol>
    <script>
        function checkstatus(){
            if('{{status}}'== 'OK'){
                toastr['success']("上传成功");
            }else if('{{status}}'== 'null'){
                toastr['error']("上传失败");
            }
        }
        function get_list(){
            $.ajax({
                url:'/getlist',
                type:'GET',
                success:function(result){
                    len_result = result.length;
                    for(var x =0; x < len_result; x++){
                        $("#filelist").append('<br><a href=/download/' + result[x] + '>' + result[x] +'</a>');
                    }
                    alert(content_list);
                },
                error:function(){
                    alert("失败");
                }
            });
        }
    checkstatus();
    get_list();
    </script>
</body>
</html>